vector_channel[], as its name already says, is vector-, not
irq-indexed.
hpet_assign_irq() sits not only in the boot path, but also in the
resume one. Short of knowing why this is, simply checking whether a
vector was already assigned prevents leaking previously assigned ones.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel);
-static int vector_channel[NR_IRQS] = {[0 ... NR_IRQS-1] = -1};
+static int vector_channel[NR_VECTORS] = {[0 ... NR_VECTORS-1] = -1};
#define vector_to_channel(vector) vector_channel[vector]
{
int vector;
+ if ( ch->vector )
+ return 0;
+
if ( (vector = assign_irq_vector(AUTO_ASSIGN_IRQ)) < 0 )
return vector;